Your application can get the registration information for any component using the GetComponentInfo function. You can use the GetComponentIconSuite function to get a handle to the component's icon suite, if any.
In addition, for components to which your application already has a connection, your application can obtain the component's version number and also determine whether the component supports a particular request by using the GetComponentVersion and ComponentFunctionImplemented functions.
The GetComponentInfo function returns all of the registration information for a component. Your application specifies the component with a component identifier returned by the FindNextComponent function. The GetComponentInfo function returns information about the component in a component description record. The GetComponentInfo function also returns the component's name, information string, and icon. (To get a handle to the component's icon suite, if it provides one, use the GetComponentIconSuite function.)
A component provides this registration information when it is registered with the Component Manager.
FUNCTION GetComponentInfo (aComponent: Component;
VAR cd: ComponentDescription;
componentName: Handle;
componentInfo: Handle;
componentIcon: Handle): OSErr;
The GetComponentInfo function returns information about the specified component in the cd , componentName , componentInfo , and componentIcon parameters.
For information on the component description record, see The Component Description Record . For information on the FindNextComponent function, see FindNextComponent . For information on registering components, see "Registering Components," .
For an example of the use of the GetComponentInfo function, see Listing 3 .
The GetComponentIconSuite function returns a handle to the component's icon suite (if it provides one).
FUNCTION GetComponentIconSuite (aComponent: Component;
VAR iconSuite: Handle): OSErr;
The GetComponentIconSuite function returns a handle to the component's icon suite. A component provides to the Component Manager the resource ID of its icon family in the optional extensions to the component resource. Your application is responsible for disposing of the returned icon suite handle.
The GetComponentVersion function returns a component's version number.
FUNCTION GetComponentVersion (ci: ComponentInstance): LongInt;
The GetComponentVersion function returns a long integer containing the version number of the component you specify. The high-order 16 bits represent the major version, and the low-order 16 bits represent the minor version. The major version specifies the component specification level; the minor version specifies a particular implementation's version number.
The ComponentFunctionImplemented function allows you to determine whether a component supports a specified request. Your application can use this function to determine a component's capabilities.
FUNCTION ComponentFunctionImplemented (ci: ComponentInstance;
ftnNumber: Integer)
: LongInt;
The ComponentFunctionImplemented function returns a long integer indicating whether the component supports the specified request. You can interpret this long integer as if it were a Boolean value. If the returned value is TRUE , the component supports the specified request. If the returned value is FALSE , the component does not support the request.